

# 今天的日期是xxx，我们来公布下xxx的出勤率是xxx，她这次考了xx分

#1、简单粗暴直接 +

import datetime
today = datetime.datetime.today()
name = "伊伊"
rate = 99.99
score = 99

# print("今天是"+str(today)+",我们来公布下"+name+"的出勤率是"+str(rate)+"她这次考了"+str(score)+"分")
# 2.占位符,%s %d %f
# %d:整数
# %f:浮点数
# %s字符串
# welcome = "今天是%s，我们来公布下%s的出勤率是%f，她这次考了%d分"%(today,name,rate,score)
# print(welcome)
#
#3.大括号的方式
# welcome2 = "今天是{today},我们来公布下{name}的出勤率是{rate},她这次考了{score}分".format(today = today,name = name,rate = rate,score = score)
# print(welcome2)

# welcome3 = "今天是{},我们来公布下{}的出勤率是{},她这次考了{}分".format(today,name,rate,score)
# print(welcome3)

# score = 97.67857
# welcome = "这次考了%.2f分"%(score)
# print(welcome)
age = 18.5
age_str = "今年%d岁"%(age)
print(age_str)